package com.my;

import com.my.service.HelloBackgroundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@RestController
@EnableFeignClients
@EnableDiscoveryClient
@EnableCircuitBreaker
//@EnableHystrixDashboard
@EnableHystrix
public class App {
    @Autowired
    private HelloBackgroundService helloBackgroundService;

    @RequestMapping("/hello")
    public String test(){
        return helloBackgroundService.hello("hello");
    }
    public static void main( String[] args ) {
        SpringApplication.run( App.class,args );
    }
}
